home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / AEanimCurveCommon.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  3.9 KB  |  139 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //    Alias|Wavefront Script File
  19. //
  20. //    Creation Date:    May 29, 1997
  21. //    Author:            ajp
  22. //
  23. //    Procedure Name:
  24. //    AEanimCurveCommon
  25. //
  26. //    Description Name;
  27. //    Creates the attribute editor controls for the animCurve node
  28. //
  29. //    Input Value:
  30. //    nodeName
  31. //
  32. //    Output Value:
  33. //    None
  34. //
  35.  
  36. global proc animCurveExpand_CB () 
  37. {
  38.     if (`checkBoxGrp -query -value1 expandChkBoxGrp`) {
  39.         keyframeOutliner -edit -display "wide" keyOutliner;
  40.     }
  41.     else {
  42.         keyframeOutliner -edit -display "narrow" keyOutliner;
  43.     }
  44. }    
  45.  
  46. global proc AEupdateWeightOptionGrp (string $parent, string $control, string $nodeName)
  47. {
  48.     setParent $parent;
  49.     int $weighted[] = `keyTangent -query -weightedTangents $nodeName`;
  50.     checkBoxGrp -edit
  51.         -value1 $weighted[0]
  52.         $control;
  53. }
  54.  
  55. global proc AEanimCurveNew (string $attr)
  56. {
  57.     string $buffer[];
  58.     tokenize($attr,".",$buffer);
  59.     string $nodeName = $buffer[0];
  60.  
  61.     string $retval = `columnLayout
  62.         -adjustableColumn true
  63.         TanimCurveLyt`;
  64.  
  65.         int $weighted[] = `keyTangent -query -weightedTangents $nodeName`;
  66.  
  67.         string $control = `checkBoxGrp
  68.             -label ""
  69.             -label1 "Weighted Tangents"
  70.             -numberOfCheckBoxes 1
  71.             -value1 $weighted[0]
  72.             -changeCommand ("keyTangent -edit -weightedTangents #1 " + $nodeName)
  73.             weightOptionGrp`;
  74.         scriptJob
  75.             -replacePrevious
  76.             -parent $control
  77.             -attributeChange ($nodeName + ".weightedTangents") ("AEupdateWeightOptionGrp " + `setParent -query` + " " + $control + " " + $nodeName);
  78.         checkBoxGrp
  79.             -label " "
  80.             -label1 "Expand Spreadsheet"
  81.             -numberOfCheckBoxes 1
  82.             -value1 false
  83.             -changeCommand "animCurveExpand_CB"
  84.             expandChkBoxGrp;
  85.         frameLayout
  86.             -label "Keys"
  87.             -labelVisible true
  88.             -borderVisible true
  89.             -collapsable false
  90.             -collapse false
  91.             keyframeLyt;
  92.  
  93.             keyframeOutliner -height 234 
  94.                 -display "narrow" keyOutliner;
  95.  
  96.         setParent ..;
  97.  
  98.     setParent ..;
  99.  
  100.     keyframeOutliner -edit -animCurve $nodeName keyOutliner;
  101. }
  102.  
  103.  
  104. global proc AEanimCurveReplace (string $attr)
  105. {
  106.     string $buffer[];
  107.     tokenize($attr,".",$buffer);
  108.     string $nodeName = $buffer[0];
  109.  
  110.     int $weighted[] = `keyTangent -query -weightedTangents $nodeName`;
  111.  
  112.     string $control = `checkBoxGrp -edit
  113.         -value1 $weighted[0]
  114.         -changeCommand ("keyTangent -edit -weightedTangents #1 " + $nodeName)
  115.         weightOptionGrp`;
  116.     scriptJob
  117.         -replacePrevious
  118.         -parent $control
  119.         -attributeChange ($nodeName + ".weightedTangents") ("AEupdateWeightOptionGrp " + `setParent -query` + " " + $control + " " + $nodeName);
  120.  
  121.     keyframeOutliner -edit -animCurve $nodeName keyOutliner;
  122. }
  123.  
  124. global proc AEanimCurveCommon( string $nodeName )
  125. {
  126.     
  127.     editorTemplate -addControl "preInfinity";
  128.     editorTemplate -addControl "postInfinity";
  129.     editorTemplate -callCustom "AEanimCurveNew" 
  130.                 "AEanimCurveReplace"
  131.                 "preInfinity";
  132.     editorTemplate -suppress "stipplePattern";
  133.     editorTemplate -suppress "outStippleThreshold";
  134.     editorTemplate -suppress "outStippleRange";
  135.     editorTemplate -suppress "inStippleRange";
  136.     editorTemplate -suppress "stippleReverse";
  137.     editorTemplate -suppress "keyValueSwitch";
  138. }
  139.